package com.example.JavaConcurrent.Project3_Phaser.forceTermination_2;



import java.util.concurrent.Phaser;

public class Run2 {
    public static void main(String[] args) throws InterruptedException {
        Phaser phaser = new Phaser(3);

        for (int i = 0; i <3 ; i++) {
            ThreadA a = new ThreadA(phaser);
             a.start();
        }

        Thread.sleep(5000);
        phaser.arriveAndDeregister();

        //参考arriveAndDeregister3_4    arriveAndDeregister-到达屏障后不向下执行


    }
}
